@echo off
:: 设置命令行编码为UTF-8（65001是UTF-8的代码页）
chcp 65001 >nul

:: 定义变量
set IMAGE_NAME=registry.cn-guangzhou.aliyuncs.com/go-deploy/gf-admin:latest
set DOCKER_USERNAME=json520
set DOCKER_PASSWORD=jingxiangmima520
set DOCKER_REGISTRY=registry.cn-guangzhou.aliyuncs.com

:: 默认执行全部操作
call :build
call :login
call :push
goto :eof

:: 构建镜像
:build
echo 开始构建 Docker 镜像...
docker build -t %IMAGE_NAME% .
goto :eof

:: 登录到Docker仓库
:login
echo 开始登录到 Docker 仓库...
echo %DOCKER_PASSWORD% | docker login --username %DOCKER_USERNAME% --password-stdin %DOCKER_REGISTRY%
goto :eof

:: 推送镜像
:push
echo 开始推送镜像到仓库...
docker push %IMAGE_NAME%
goto :eof



